import VueRouter from 'vue-router'
import AdminPatient from "@/pages/administer/AdminPatient.vue";
import AdminDoctor from "@/pages/administer/AdminDoctor.vue";
import Login from "@/pages/login/login.vue"
import Index from "@/pages/administer/Index.vue";
import NotFound from "@/pages/error/404NotFound.vue";
import err500 from "@/pages/error/err500";
import PatientIndex from "@/pages/patient/PatientIndex";

const router = new VueRouter({
    routes: [
        {
          path:"/patientIndex",
          component:PatientIndex,
          name:'patientIndex'
        },
        {
            path: '/login',
            component: Login,
            name: 'login',
        },
        {
            path: '/index',
            component: Index,
            name: 'index',
            redirect: '/index/adminPatient',
            children: [
                {
                    path: 'adminPatient',
                    component: AdminPatient,
                    name: 'adminPatient'
                },
                {
                    path: 'adminDoctor',
                    component: AdminDoctor,
                    name: 'adminDoctor'
                }]
        },
        //404错误
        {
            path: '*',
            component: NotFound,
            name: "err404"
        },
        //TODO:服务器错误
        {
            path: '/500',
            component: err500,
            name: 'err500'
        }
    ]
})

export default router